package com.IODemo.ByteStream;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author milian
 * @Date 2021/7/27 0027 18:57
 */
public class test1 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("H:\\test\\2.jpg");
        FileInputStream fis = new FileInputStream("H:\\test\\1.jpg");
        byte[] bytes = new byte[1024];
        int len;
        while ((len=fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }
        fos.close();
        fis.close();
    }
}
